package offer;

public class Class04 {


    public boolean findNumberIn2DArray(int[][] matrix, int target) {

//        todo:缺少判断条件

        if(matrix.length==0)
            return false;

        int x = matrix.length;
        int y = matrix[0].length;
        int i=0;
        int j=y-1;
        while (i<x&&j>=0){
            if (matrix[i][j]==target){
                return  true;
            }else if (matrix[i][j]>target){
                j--;
            }else {
                i++;
            }


        }
        return  false;
    }


    public  void  test(){
        int[][] a={{2,3,4}};
        System.out.println(a[0].length);
    }



    public static void main(String[] args) {

        Class04 class04 = new Class04();
        class04.test();

    }




}
